<?php
namespace Manager\Controller;
use Home\Controller\CommonController;
class IndexController extends CommonController {
	
	function _initialize(){
		parent::_initialize();
	}
	
	public function index(){
		$user = $_SESSION['_loginUser_home'];
		$role = M('Users')->where(array('uid'=>$user['uid'],'status'=>1))->getField('role');
		if($role === 'teacher' ||  strpos($role,'XIAOWU_ADMIN')>0){
			$tpl = 'fun';
		}else{
			$tpl = 'noaccess';
		}
		if(strpos($role,'XIAOWU_ADMIN')){
			$this->did = M('AuthGroup')->where(array('title'=>$role))->getField('xiaoqu');
		}
		$this->role = $role;
		$this->display($tpl);
	}
}